#pragma once
#include "igamestate.h"
#include "../Bitmap Font/BitmapFont.h"
#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "../SGD Wrappers/SGD_Math.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../SGD Wrappers/CSGD_XAudio2.h"
#include "../SGD Wrappers/tinyxml.h"
#include <vector>
using std::vector;

struct tPlayerInfo
{
	char m_cName[4];
	int m_nScore;
	bool operator>(const tPlayerInfo& that) const { if (this->m_nScore > that.m_nScore) return true; else return false; }
};

class CHighScoresState : public IGameState
{

public:
	static CHighScoresState* GetInstance(void);
//IGameState Interface======================
	virtual void Enter(void);
	virtual void Update(float fElapsedTime);
	virtual void Exit(void);
	virtual void Render(void);
	virtual bool Input(void);
//==========================================

	void GeneratePlayers(vector <tPlayerInfo>& vPlayers);
	void DisplayPlayers(const vector<tPlayerInfo>& vPlayers);
	bool LoadPlayers(vector<tPlayerInfo>& vPlayers, const char* szFileName);
	void SavePlayers (const vector <tPlayerInfo>& vPlayers, const char* szFileName);

private:
//trilogy of evil===========================
	CHighScoresState(void);
	CHighScoresState (const CHighScoresState&);
	virtual ~CHighScoresState(void);
	CHighScoresState& operator=(const CHighScoresState&);

	CSGD_Direct3D*			m_pD3D;
	CSGD_TextureManager*	m_pTM;
	CSGD_DirectInput*		m_pDI;
	CSGD_XAudio2*			m_pXA;

	vector<tPlayerInfo>		vPlayers;
	short					m_sVol;
	int						m_nScreenWidth;
	int						m_nScreenHeight;
	int						m_nBackGroundImageID;
	CBitmapFont*			m_pFont;
};

